/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


Ext.apply(Ext.form.VTypes,{
    num: function(val,field){
        return val;
	},
    numMask:/[\d]/,


    textspace: function(val,field){
        return val;
    },
    textspaceMask:/[(\a-zA-Z\$ \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1\)]/
/*    nombre:function(val,field){
        var regExp=/^[(a-zA-Z0-9 \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1.\,\/\-)]+$/;
        ///^[a-zA-Z ][-_.a-zA-Z0-9 ]{0,30}$/;
        return regExp.test(val);
    },
    nombreMask:/^[(a-zA-Z0-9 \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1)]+$/,
    nombreText:'Nombre no v&aacute;lido'
	
	capitalize:function(val,field) {
				var words = val.split(/\s/);
					for (i = 0; i < words.length; i++) {
						words[i] = Ext.util.Format.capitalize(words[i]);
					}
				field.setRawValue(words.join(' '));
				return true;
	},
    lowercaseMask:/[-_.a-z0-9]/,
	lowercaseText:'Texto no permitido.',
        lowercase:function(val,field) {
				var words = val.split(/\s/);
					for (i = 0; i < words.length; i++) {
						words[i] = Ext.util.Format.lowercase(words[i]);
					}
				field.setRawValue(words.join(' '));
				return true;
	},
	numMask:/[\d\$.]/,
	num:function(val,field){
		  			return val;
	},

	password: function(val, field){
		   	  this.passwordText = 'Ocho caracteres m&iacute;nimo.';
		      return(val.length >= 8);
	},
	vpasswordText : 'Las contrase&#243as no coinciden',
	vpassword : function(val, field) {
		if (field.initialPassField) {
			var pwd = Ext.get(field.initialPassField).getValue();
			return (val == pwd);
		}
		return true;
	},
	nombreMask:/^[(a-zA-Z0-9 \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1.\,\/\-)]+$/,
	nombreText:'Nombre no v&aacute;lido',
	nombre:function(val,field){
		var regExp=/^[(a-zA-Z0-9 \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1.\,\/\-)]+$/;
		///^[a-zA-Z ][-_.a-zA-Z0-9 ]{0,30}$/;
		return regExp.test(val);
	},
        descripcionMask:/^[(a-zA-Z0-9 \s\u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1\u003F\u00BF.\,\"\'\;\:\/\-)]+$/,
	descripcionText:'Descripci&oacute;n no v&aacute;lido',
	descripcion:function(val,field){
		var regExp=/^[(a-zA-Z0-9 \s\u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1\u003F\u00BF.\,\"\'\;\:\/\-)]+$/;
		///^[a-zA-Z ][-_.a-zA-Z0-9 ]{0,30}$/;
		return regExp.test(val);
	},
        nombrepersonaMask:/^[(a-zA-Z \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1]+$/,
	nombrepersonaText:'Nombre no v&aacute;lido',
	nombrepersona:function(val,field){
		var regExp=/^[(a-zA-Z \u00e1\u00c1\u00e9\u00c9\u00ed\u00cd\u00f3\u00d3\u00fa\u00da\u00f1\u00d1]+$/;
		///^[a-zA-Z ][-_.a-zA-Z0-9 ]{0,30}$/;
		return regExp.test(val);
	}*/
});

